from django.contrib import admin
from index.models import Question
from index.models import Answer


# class AnswerAdmin(admin.ModelAdmin):
class AnswerLine(admin.StackedInline):
    model = Answer
    extra = 4


class QuestionAdmin(admin.ModelAdmin):
    fieldsets = [
        (None, {
         'fields': ['question', ]
         }),
        ('Image', {
         'fields': ['image']
         }),
        ('Other', {
         'fields': ['pub_time', 'question_type'],
         'classes': ['collapse'],
         })

    ]

    inlines = [AnswerLine]


#admin.site.register(Login, LoginAdmin)
admin.site.register(Question, QuestionAdmin)
# Register your models here.
